<?php
//好物频道改版 福利社板块新增住友参与人数
error_reporting(E_ALL ^ E_NOTICE);
require_once '/data/wwwroot/g_vendor/autoload.php';

use Doraemon\model\McnUser;
use Doraemon\model\McnUserExtendInfo;
use Biz\cache\activity\McnUser as cacheMcnUser;
use hhz\constant\redis\redisKeys;

try {
   $uids =    McnUser::selectByWhere([
        'level' => McnUser::MCN_LIST,
        'status' => McnUser::STATUS_NORMAL
    ] ,"uid");
    $info =  McnUserExtendInfo::selectByWhere([
       'uid' => $uids,
       'personal_preference[!]' => ''
   ] ,['uid' ,'personal_preference' ]);
    $data = [];
    foreach($info as $val){
       $personal_tags = explode(",", $val['personal_preference']);
       $data[] = $val['uid']."-".$personal_tags[0];
    }
//    cacheMcnUser::setItems($data);

    $sConstKey = redisKeys::KEY_C_OTHER_MCN_USER;
    $redis = new \Hhz\Redis\otherRedis($sConstKey);
    $redis->del($sConstKey);
    $redis->sadd($sConstKey,$data);
    $redis->expire($sConstKey, 86400 *2);

} catch (\Doraemon\tools\Presto\PrestoException $e) {

}








